package com.danco.training.bookshop.comparator;

import java.io.Serializable;
import java.util.Date;
import java.util.Comparator;

import com.danco.training.bookshop.entity.Order;

public class OrderComparatorByOrderDate implements Comparator<Order>,Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -1628812657864559687L;

	public int compare(Order o1, Order o2) {
		Date d1 = o1.getOrderDate();
		Date d2 = o2.getOrderDate();
		return d1.compareTo(d2);
	}

}
